package main

import "fmt"

func get5() int32 {
	return 5
}

func getMinus5() int32 {
	return -5
}

func main() {

	y := get5()
	switch y {
	default:
		fmt.Println("default")
	case 0, 1, 2, 3:
		fmt.Println("0, 1, 2, 3")
	case 4, 5, 6, 7:
		fmt.Println("4, 5, 6, 7")
	}

	// 
	switch x := getMinus5(); { // missing switch expression means "true"
	case x < 0:
		fmt.Println(x, "< 0")
	default:
		fmt.Println(x, ">= 0")
	}

	x := getMinus5()
	switch {
	case x < y:
		fmt.Println("x < y")
	case x < 10:
		fmt.Println("x < 10")
	case x == 4:
		fmt.Println("x == 4")
	}

	
	// switch i := x.(type) {
	// case nil:
	// 	fmt.Println("x is nil") // type of i is type of x (interface{})
	// case int:
	// 	fmt.Println("x is int, ", i) // type of i is int
	// case float64:
	// 	fmt.Println("x is float64, ", i) // type of i is float64
	// case func(int) float64:
	// 	fmt.Println("x is func, ", i) // type of i is func(int) float64
	// case bool, string:
	// 	fmt.Println("type is bool or string") // type of i is type of x (interface{})
	// default:
	// 	fmt.Println("don't know the type") // type of i is type of x (interface{})
	// }
}
